// inspired by https://www.youtube.com/watch?v=Pl1Gw14pS2I
.mainPage {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0 60px 60px;
  height: 100%;
  overflow: hidden;
  position: relative;
  min-width: 1280px;
  max-width: 1920px;
  margin: 0 auto;

  .chatContent {
    position: relative;
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
    flex-grow: 1;
    margin-right: 40px;
    height: calc(100% - 60px);
    overflow-y: hidden;
    padding: 32px 0;
    box-sizing: border-box;

    .top {
      height: calc(100% - 110px);
      overflow-y: auto;
      margin-bottom: 40px;
    }

    .top::-webkit-scrollbar {
      width: 6px;
    }

    .top::-webkit-scrollbar-track {
      background-color: rgba(255, 255, 255, 0);
      border-radius: 100px;
    }

    .top::-webkit-scrollbar-thumb {
      background-color: rgba(255, 255, 255, 0);
      border-radius: 100px;
    }

    .question {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 40px;

      span {
        padding: 12px 20px;
        color: #121316;
        font-size: 14px;
        line-height: 24px;
        border-radius: 8px;
        background: #FFF;
        max-width: 93.75%;
      }
    }

    .end {
      position: absolute;
      right: 0;
      background-color: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
      border-left: 1px solid #D7D8DD;
      padding-left: 16px;

      .node {
        position: relative;

        &::before {
          content: "";
          border: 1px solid #D7D8DD;
          border-top: none;
          border-left: none;
          width: calc(16px - 2px);
          height: 0px;
          position: absolute;
          left: -16px;
          top: 50%;
          // transform: translateY(-50%);
        }

        article {
          padding: 8px 16px;
          border-radius: 8px;
          border: 1px solid transparent;
          color: #4082FE;
          text-align: center;
          font-size: 14px;
          line-height: 24px;
          box-sizing: border-box;
          background: rgba(232, 233, 249);
          color: #2126C0;
        }
      }
    }

    .answer {
      border-radius: 8px;
      background: rgba(33, 38, 192, 0.10);
      padding: 12px;

      .inner {
        width: 100%;
        background-color: #fff;
        border-radius: 4px;
        padding: 8px;
        box-sizing: border-box;
        transition: all 0.5s ease;
        margin-bottom: 18px;

        .mapArea {
          width: 100%;
          overflow-x: auto;
          overflow-y: hidden;

          &::-webkit-scrollbar {
            height: 6px;
          }

          &::-webkit-scrollbar-track {
            background-color: rgba(255, 255, 255, 0);
            border-radius: 10px;
          }

          &::-webkit-scrollbar-thumb {
            background-color: #d7d8dd;
            border-radius: 100px;
          }
        }

      }


      .response {
        color: #121316;
        font-size: 14px;
        line-height: 24px;
        padding: 18px 42px;

        h3 {
          font-size: 24px;
          font-weight: 600;
          line-height: 36px;
          margin: 0 0 16px 0;
        }

        h4 {
          font-size: 20px;
          font-weight: 600;
          line-height: 30px;
          margin: 0 0 8px 0;
        }

        p {
          color: rgba(18, 19, 22, 0.80);
          font-size: 16px;
          font-weight: 400;
          line-height: 28px;
          margin: 0 0 16px 0;
        }

        ul {
          margin-bottom: 8px;
          padding-left: 22px;
        }

        li {
          color: rgba(18, 19, 22, 0.80);
          font-size: 16px;
          font-weight: 400;
          line-height: 28px;

          p {
            margin-bottom: 4px;
          }
        }
      }
    }

    .sendArea {
      display: flex;
      width: 100%;
      box-sizing: border-box;
      padding: 10px 12px 10px 24px;
      justify-content: space-between;
      align-items: center;
      border-radius: 8px;
      border: 2px solid var(--fill-5, #464A53);
      background: #FFF;
      position: relative;

      :global {
        .ant-input {
          &:focus {
            box-shadow: none !important;
            outline: 0 !important;
          }
        }
      }

      input {
        height: 36px;
        line-height: 36px;
        flex-grow: 1;
        border: 0;
        outline: 0;

        &:focus {
          border: 0;
          outline: 0;
        }
      }

      button {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        border: 0;
        background-color: #fff;
        cursor: pointer;
        padding: 8px;
        width: 65px;
        flex-shrink: 0;

        img {
          margin-right: 4px;
        }
      }
    }

    .notice {
      color: #12131659;
      padding-top: 8px;
      text-align: center;
      font-weight: 400;

      a {
        text-decoration: none;
        color: #444;
        display: inline-flex;
        align-items: center;

        span {
          font-size: 18px;
        }
      }
    }
  }

  .progressContent {
    width: 44.44%;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 24px;
    border-radius: 8px;
    border: rgba(33, 38, 192, 0.10);
    background: rgba(255, 255, 255, 0.80);
    height: calc(100% - 60px);
    overflow-y: auto;
    position: relative;

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-track {
      background-color: rgba(255, 255, 255, 0);
      border-radius: 100px;
    }

    &::-webkit-scrollbar-thumb {
      background-color: rgba(255, 255, 255, 0);
      border-radius: 100px;
    }

    .toggleIcon {
      position: absolute;
      right: 24px;
      top: 28px;
      cursor: pointer;
    }

    .titleNode {
      color: #121316;
      font-size: 24px;
      font-weight: 600;
      line-height: 36px;
      margin-bottom: 24px;
    }

    .conclusion {
      padding-top: 8px;
      color: #121316;
      font-size: 14px;
      line-height: 24px;

      ul {
        padding-left: 24px;
      }
    }

    .steps {
      .title {
        color: var(--100-text-5, #121316);
        font-size: 20px;
        font-weight: 600;
        line-height: 30px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        position: relative;

        .open {
          position: absolute;
          right: 0;
          font-size: 20px;
          font-weight: normal;

          span {
            color: #121316;
            opacity: 0.6;
          }
        }

        i {
          width: 12px;
          height: 12px;
          border-radius: 50%;
          background-color: #2126C0;
          margin-right: 8px;
        }
      }

      &.thinking,
      &.select {
        margin-bottom: 24px;
      }

      &.select {
        .searchList {
          margin-top: 0 !important;
          border-radius: 8px;
          background: var(--fill-2, #F4F5F9);
          padding: 8px;
        }
      }

      .con {
        margin-left: 5px;
        padding-top: 8px;
        padding-left: 15px;
        border-left: 1px solid rgba(33, 38, 192, 0.20);
        height: auto;

        &.collapsed {
          overflow: hidden;
          height: 0;
          padding-top: 0;
          transition: all 1s;
        }

        .subTitle {
          color: var(--100-text-5, #121316);
          font-size: 14px;
          font-weight: 600;
          line-height: 24px;
          margin-bottom: 4px;

          span {
            margin-right: 4px;
          }
        }

        .query,
        >.searchList {
          margin-top: 24px;
          // margin-bottom: 24px;
        }

        .query {
          &-Item {
            display: inline-flex;
            padding: 4px 8px;
            margin-right: 4px;
            margin-bottom: 4px;
            border-radius: 4px;
            border: 1px solid #EBECF0;
            color: rgba(18, 19, 22, 0.80);
            font-size: 14px;
            line-height: 24px;
            height: 32px;
            box-sizing: border-box;
            overflow: hidden;
            // animation: fadeIn linear 2s;
          }
        }

        .searchList {
          .thought {
            color: rgba(18, 19, 22, 0.80);
            font-size: 14px;
            line-height: 24px;
            margin-bottom: 16px;
          }

          .scrollCon {
            padding-right: 6px;
            max-height: 300px;
            overflow-y: auto;
            position: relative;
          }

          .scrollCon::-webkit-scrollbar {
            width: 6px;
          }

          .scrollCon::-webkit-scrollbar-track {
            background-color: rgba(255, 255, 255, 0);
            border-radius: 100px;
          }

          .scrollCon::-webkit-scrollbar-thumb {
            background-color: #d7d8dd;
            border-radius: 100px;
          }

          .inner {
            width: 100%;
            border-radius: 8px;
            background: var(--fill-2, #F4F5F9);
            transition: all 0.5s ease;
            box-sizing: border-box;
            padding: 8px;
          }

          .searchItem {
            border-radius: 8px;
            background: var(---fill-0, #FFF);
            margin-bottom: 6px;
            padding: 4px 8px;
            transition: all 0.5s ease-in-out;

            &.highLight {
              border: 1px solid var(---Success-6, #00B365);
              background: linear-gradient(0deg, rgba(218, 242, 228, 0.40) 0%, rgba(218, 242, 228, 0.40) 100%), #FFF;
            }

            p {
              white-space: nowrap;
              max-width: 95%;
              overflow: hidden;
              text-overflow: ellipsis;
              margin: 0;
            }

            p.summ {
              color: rgba(18, 19, 22, 0.80);
              font-size: 13px;
              line-height: 20px;
              margin-bottom: 2px;
            }

            p.url {
              color: var(--60-text-3, rgba(18, 19, 22, 0.60));
              font-size: 12px;
              line-height: 18px;
              padding-left: 20px;
            }
          }
        }


      }
    }
  }
}

pre {
  margin: 0;
  padding-top: 8px;
  color: #121316;
  font-size: 14px;
  line-height: 24px;
  font-family: 'PingFang SC', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  white-space: wrap;
}

ul {
  margin: 0;
  padding: 0;
}

.draft {
  width: 100%;
  white-space: wrap;
  // display: flex;
  // justify-content: flex-start;
  // align-items: flex-start;
  position: relative;

  .loading,
  .loading>div {
    position: relative;
    box-sizing: border-box;
  }

  .loading {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0;
    color: #fff;
    background-color: #f90;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 3px;
    flex-shrink: 0;
    position: absolute;
    top: 0;
    left: 0;
  }

  .loading>div {
    display: inline-block;
    float: none;
    background-color: currentColor;
    border: 0 solid currentColor;
  }

  .loading>div:nth-child(1) {
    animation-delay: -200ms;
  }

  .loading>div:nth-child(2) {
    animation-delay: -100ms;
  }

  .loading>div:nth-child(3) {
    animation-delay: 0ms;
  }

  .loading>div {
    width: 3px;
    height: 3px;
    margin: 2px 1px;
    border-radius: 100%;
    animation: ball-pulse 1s ease infinite;
  }
}

.mindmap {
  position: relative;

  article {
    padding: 6px 16px;
    border-radius: 8px;
    height: 38px;
    border: 1px solid transparent;
    background: #FFF;
    color: #121316;
    text-align: center;
    font-size: 14px;
    line-height: 24px;
    position: relative;
    box-sizing: border-box;

    &.loading {
      line-height: 20px;
      border-radius: 8px;
      overflow: hidden;
      border: 1px solid transparent;
      padding: 4px;

      span {
        color: #2126C0;
        background-color: #fff;
        border-radius: 4px;
        line-height: 24px;
        padding: 2px 12px;
      }

      .looping {
        --border-width: 4px;
        --follow-panel-linear-border: linear-gradient(91deg,
            #5551FF 0.58%,
            #FF87DE 100.36%);

        position: absolute;
        top: 0;
        left: 0;
        width: calc(100% + var(--border-width) * 2 - 8px);
        height: calc(100%);
        background: var(--follow-panel-linear-border);
        background-size: 300% 300%;
        background-position: 0 50%;
        animation: moveGradient 4s alternate infinite;
      }
    }

    &.disabled {
      border-radius: 8px;
      border: 1px solid #D7D8DD;
      color: rgba(18, 19, 22, 0.35);
    }

    &.finished {
      // cursor: pointer;
      border: 1px solid #2126C0;

      .finishDot {
        position: absolute;
        top: 6px;
        right: 6px;
        width: 6px;
        height: 6px;
        background-color: #C9C0FE;
        border-radius: 50%;
      }
    }

    &.init {
      border: 1px solid transparent;
      cursor: auto;
    }

    span {
      display: block;
      white-space: nowrap;
      max-width: 160px;
      overflow: hidden;
      text-overflow: ellipsis;
      position: relative;
      z-index: 20;
    }

    span.status {
      color: #4082FE;
    }

  }

  // 第一个article，起始节点
  >li {
    >article {
      border-radius: 8px;
      background: rgba(33, 38, 192, 0.10);
      color: #2126C0;
    }
  }

  li {
    list-style: none;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    margin: 16px;
    line-height: 1;
    position: relative;

    &>ul.onlyone {
      &:before {
        opacity: 0;
      }

      >li {
        margin-left: 0px;
      }

      &>li:after {
        opacity: 0;
      }

      &>li:before {
        // left: 0;
      }
    }

    &>ul:before {
      content: "";
      border: 1px solid #D7D8DD;
      border-top: none;
      border-left: none;
      width: calc(16px - 2px);
      height: 0px;
      position: absolute;
      left: 0;
      top: 50%;
      // transform: translateY(-50%);
    }

    &:before {
      content: "";
      border: 1px solid #D7D8DD;
      border-top: none;
      border-left: none;
      width: 16px;
      height: 0px;
      position: absolute;
      left: calc(-16px - 1px);
    }

    &:after {
      content: "";
      border: 1px solid #D7D8DD;
      border-top: none;
      border-left: none;
      width: 0px;
      height: calc(100% / 2 + 33px);
      position: absolute;
      left: calc(-16px - 2px);
    }

    &:first-of-type:after {
      top: 50%;
    }

    &:last-of-type:after {
      bottom: 50%;
    }

    ul {
      padding: 0 0 0 16px;
      position: relative;
    }
  }

  &>li {

    &:after,
    &:before {
      display: none;
    }
  }

  .endLine {
    border-bottom: 1px solid #D7D8DD;
    width: 3000px;
    transition: width 1s ease-in-out;
  }
}

.showRight {
  position: fixed;
  top: 80px;
  right: -10px;
  width: 42px;
  cursor: pointer;

  img {
    width: 100%;
  }
}

@keyframes ball-pulse {

  0%,
  60%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  30% {
    opacity: 0.1;
    transform: scale(0.01);
  }
}

@keyframes moveGradient {
  50% {
    background-position: 100% 50%;
  }
}

@keyframes fadeIn {
  0% {
    width: 0;
    opacity: 0;
  }

  100% {
    width: auto;
    opacity: 1;
  }
}

@keyframes unfold {
  0% {
    height: auto;
  }

  100% {
    height: 0;
  }
}


.loading99 {
  margin: 20px;
  position: relative;
  width: 1px;
  height: 1px;
}

.loading99:before,
.loading99:after {
  position: absolute;
  display: inline-block;
  width: 15px;
  height: 15px;
  content: "";
  border-radius: 100%;
  background-color: #5551FF;
}

.loading99:before {
  left: -15px;
  animation: ball-pulse infinite 0.75s -0.4s cubic-bezier(0.2, 0.68, 0.18, 1.08);
}

.loading99:after {
  right: -15px;
  animation: ball-pulse infinite 0.75s cubic-bezier(0.2, 0.68, 0.18, 1.08);
}

@keyframes ball-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.1);
    opacity: 0.6;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}
